import 'package:flutter/material.dart';

import 'package:get/get.dart';
import 'package:getwidget/colors/gf_color.dart';
import 'package:getwidget/components/button/gf_button.dart';
import 'package:getwidget/components/button/gf_icon_button.dart';
import 'package:getwidget/getwidget.dart';
import 'package:getwidget/shape/gf_button_shape.dart';
import 'package:getwidget/types/gf_button_type.dart';

import '../controllers/gfbutton_controller.dart';

class GfbuttonView extends GetView<GfbuttonController> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('按钮'),
        centerTitle: true,
      ),
      body: Container(
        margin: EdgeInsets.all(10),
        child: ListView(
          children: [
            Text(
              '按钮颜色',
              style: Theme.of(context).textTheme.headline5
            ),
            Wrap(
              alignment: WrapAlignment.spaceBetween,
              children: [
                GFButton(
                  onPressed: (){},
                  text: "PRIMARY",
                  color: GFColors.PRIMARY,
                ),
                GFButton(
                  onPressed: (){},
                  text: "SECONDARY",
                  color: GFColors.SECONDARY
                ),
                GFButton(
                  onPressed: (){},
                  text: "DANGER",
                  color: GFColors.DANGER
                ),
                GFButton(
                  onPressed: (){},
                  text: "DARK",
                  color: GFColors.DARK
                ),
                GFButton(
                  onPressed: (){},
                  text: "WARNING",
                  color: GFColors.WARNING
                ),
                GFButton(
                  onPressed: (){},
                  text: "SUCCESS",
                  color: GFColors.SUCCESS
                ),
                GFButton(
                  onPressed: (){},
                  text: "INFO",
                  color: GFColors.INFO
                ),
                GFButton(
                  onPressed: (){},
                  text: "FOCUS",
                  color: GFColors.FOCUS
                ),
                GFButton(
                  onPressed: (){},
                  text: "ALT",
                  color: GFColors.ALT
                ),
                GFButton(
                  onPressed: (){},
                  text: "LIGHT",
                  color: GFColors.LIGHT
                ),
                GFButton(
                  onPressed: (){},
                  text: "TRANSPARENT",
                  color: GFColors.TRANSPARENT
                ),
                GFButton(
                  onPressed: (){},
                  text: "WHITE",
                  color: GFColors.WHITE
                ),
              ],
            ),   
            Divider(),

            Text(
              '按钮尺寸',
              style: Theme.of(context).textTheme.headline5
            ),
            Wrap(
              alignment: WrapAlignment.spaceBetween,
              children: [
                GFButton(
                  onPressed: (){},
                  text: "大按钮-LARGE",
                  size: GFSize.LARGE
                ),
                GFButton(
                  onPressed: (){},
                  text: "中等按钮-MEDIUM",
                  size: GFSize.MEDIUM
                ),
                GFButton(
                  onPressed: (){},
                  text: "小按钮-SMALL",
                  size: GFSize.SMALL
                ),
                GFButton(
                  onPressed: (){},
                  text: "宽度适配按钮 - fullWidthButton",
                  fullWidthButton: true,
                ),
              ]
            ),
            Divider(),

            Text(
              '按钮形状',
              style: Theme.of(context).textTheme.headline5
            ),
            Wrap(
              alignment: WrapAlignment.spaceBetween,
              children: [
                GFButton(
                  onPressed: (){},
                  text: "Elevated Button",
                  shape: GFButtonShape.standard,
                ),
                GFButton(
                  onPressed: (){},
                  text: "Pills Button",
                  shape: GFButtonShape.pills,
                ),
                GFButton(
                  onPressed: (){},
                  text: "Square Button",
                  shape: GFButtonShape.square,
                ),
              ]
            ),
            Divider(),

            Text(
              '按钮类型',
              style: Theme.of(context).textTheme.headline5
            ),
            Wrap(
              alignment: WrapAlignment.spaceBetween,
              children: [
                GFButton(
                  onPressed: (){},
                  text: "实心按钮 - solid",
                  type: GFButtonType.solid,
                ),
                GFButton(
                  onPressed: null,
                  text: "禁用按钮",
                  type: GFButtonType.solid,
                ),
                GFButton(
                  onPressed: (){},
                  text: "空心按钮 - outline",
                  type: GFButtonType.outline,
                ),
                GFButton(
                  onPressed: (){},
                  text: "空心按钮 - outline2x",
                  type: GFButtonType.outline2x,
                ),
                GFButton(
                  onPressed: (){},
                  text: "透明按钮 - transparent",
                  type: GFButtonType.transparent,
                ),
              ]
            ),
            Divider(),

            Text(
              '其他',
              style: Theme.of(context).textTheme.headline5
            ),
            Wrap(
              alignment: WrapAlignment.spaceBetween,
              children: [
                GFButton(
                  onPressed: (){},
                  text: "Facebook",
                  icon: Icon(Icons.facebook, color: Colors.blue),
                  type: GFButtonType.transparent,
                  size: GFSize.LARGE
                ),
                GFButton(
                  onPressed: (){},
                  text: "分享",
                  icon: Icon(Icons.share, color: Colors.blue),
                  type: GFButtonType.outline2x,
                  shape: GFButtonShape.pills,
                ),
                GFButton(
                  onPressed: (){},
                  text: '设置',
                  icon: Icon(Icons.settings, color: Colors.white),
                  color: GFColors.SUCCESS,
                ),
              ],
            ),
            
          ],
        ),
      )
    );
  }
}
